import request from "@/utils/request";
import cfg from "@/config/config";

const personDetails = {
  /**
   * 年假视图
   * @return
   * njcount 总年假  remnantNj 剩余年假  useNj 已使用年假  ratioNj  剩余年假比例
   */
  findNjView: () => {
    return request("get", cfg.apiUrl + "/api/personDetails/annual");
  },

  /**
   * 调休视图
   * @return
   * txcount 总调休  remnantTx 剩余调休  useTx 已使用调休  ratioTx  剩余调休比例
   */
  findTxView: () => {
    return request("get", cfg.apiUrl + "/api/personDetails/offduty");
  },

  // 获取请假记录
  getLeaveRecords: (param) => {
    return request("get", cfg.apiUrl + "/app/leave/personal/list",param);
  },
  // 获取加班记录
  getOvertimeRecords: (param) => {
    return request("get", cfg.apiUrl + "/app/overtime/personal/list",param);
  },
  // 获取考勤记录
  getPersonTimecards: (param) => {
    return request("get", cfg.apiUrl + "api/personDetails/getPersonTimecard",param);
  },
  // 获取补出勤记录
  getAttendanceRecords: (param) => {
    return request("get", cfg.apiUrl + "/app/repair/personal/list",param);
  }
};

export default personDetails;
